/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "news_catlog_platform")
//@NamedQueries({@NamedQuery(name = "NewsCatlogPlatform.findAll", query = "SELECT n FROM NewsCatlogPlatform n"), @NamedQuery(name = "NewsCatlogPlatform.findByMplatform", query = "SELECT n FROM NewsCatlogPlatform n WHERE n.newsCatlogPlatformPK.mplatform = :mplatform"), @NamedQuery(name = "NewsCatlogPlatform.findByMagent", query = "SELECT n FROM NewsCatlogPlatform n WHERE n.newsCatlogPlatformPK.magent = :magent"), @NamedQuery(name = "NewsCatlogPlatform.findByMserialnum", query = "SELECT n FROM NewsCatlogPlatform n WHERE n.newsCatlogPlatformPK.mserialnum = :mserialnum"), @NamedQuery(name = "NewsCatlogPlatform.findByMlocale", query = "SELECT n FROM NewsCatlogPlatform n WHERE n.newsCatlogPlatformPK.mlocale = :mlocale")})
public class NewsCatlogPlatform implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected NewsCatlogPlatformPK newsCatlogPlatformPK;
    @JoinColumn(name = "catlogid", referencedColumnName = "catlogid")
    @ManyToOne
    private NewsCatlog catlogid;

    public NewsCatlogPlatform() {
    }

    public NewsCatlogPlatform(NewsCatlogPlatformPK newsCatlogPlatformPK) {
        this.newsCatlogPlatformPK = newsCatlogPlatformPK;
    }

    public NewsCatlogPlatform(String mplatform, String magent, String mserialnum, String mlocale) {
        this.newsCatlogPlatformPK = new NewsCatlogPlatformPK(mplatform, magent, mserialnum, mlocale);
    }

    public NewsCatlogPlatformPK getNewsCatlogPlatformPK() {
        return newsCatlogPlatformPK;
    }

    public void setNewsCatlogPlatformPK(NewsCatlogPlatformPK newsCatlogPlatformPK) {
        this.newsCatlogPlatformPK = newsCatlogPlatformPK;
    }

    public NewsCatlog getCatlogid() {
        return catlogid;
    }

    public void setCatlogid(NewsCatlog catlogid) {
        this.catlogid = catlogid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (newsCatlogPlatformPK != null ? newsCatlogPlatformPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NewsCatlogPlatform)) {
            return false;
        }
        NewsCatlogPlatform other = (NewsCatlogPlatform) object;
        if ((this.newsCatlogPlatformPK == null && other.newsCatlogPlatformPK != null) || (this.newsCatlogPlatformPK != null && !this.newsCatlogPlatformPK.equals(other.newsCatlogPlatformPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.NewsCatlogPlatform[newsCatlogPlatformPK=" + newsCatlogPlatformPK + "]";
    }

}
